import request from '@/utils/request'
export const menuList= {
  "msg": "操作成功",
  "code": 200,
  "data": [
    {
      "path": "/aichat",
      "component": "Layout",
      "redirect": 'noRedirect',
      "children": [
        {
          "path": "ai-chat",
          "component": "chat/index",
          "name": 'AIChat',
          "meta": { title: 'AI会话', icon: 'wechat', affix: true }
        }
      ]
    },
    {
      "name": "Ai",
      "path": "/ai",
      "hidden": false,
      "redirect": "noRedirect",
      "component": "Layout",
      "alwaysShow": true,
      "meta": {
        "title": "人工智能",
        "icon": "tool",
        "noCache": false
      },
      "children": [
        {
          "name": "Knowledge",
          "path": "knowledge",
          "hidden": false,
          "component": "knowledge/index",
          "meta": {
            "title": "知识库管理",
            "icon": "build",
            "noCache": false
          }
        },
        {
          "name": "AIAgent",
          "path": "ai-agent",
          "hidden": false,
          "component": "ai-agent/ai-agent-list",
          "meta": {
            "title": "智能体管理",
            "icon": "peoples",
            "noCache": false
          }
        },
        {
          "name": "AIApiIndex",
          "path": "ai-api-index",
          "hidden": false,
          "component": "ai-api/ai-api-index",
          "meta": {
            "title": "模型管理",
            "icon": "redis",
            "noCache": false
          }
        },
        {
          "name": "AIToolsIndex",
          "path": "ai-tools-index",
          "hidden": false,
          "component": "ai-tools/ai-tools-index",
          "meta": {
            "title": "工具",
            "icon": "tool",
            "noCache": false
          }
        },
        {
          "name": "Config",
          "path": "config",
          "hidden": false,
          "component": "ai-config/ai-config-index",
          "meta": {
            "title": "参数设置",
            "icon": "edit",
            "noCache": false,
            "link": null
          }
        }
      ]
    },
    {
      "name": "Tool",
      "path": "/tool",
      "hidden": false,
      "redirect": "noRedirect",
      "component": "Layout",
      "alwaysShow": true,
      "meta": {
        "title": "系统工具",
        "icon": "tool",
        "noCache": false
      },
      "children": [
        {
          "name": "Build",
          "path": "build",
          "hidden": false,
          "component": "tool/build/index",
          "meta": {
            "title": "表单构建",
            "icon": "build",
            "noCache": false
          }
        }
      ]
    },
  ]
}


// 获取路由
export const getRouters = () => {
  // return request({
  //   url: '/getRouters',
  //   method: 'get'
  // })
  console.log("getRouters")
  return new Promise((resolve, reject) => {
    // let res = JSON.parse(menuListJson);
    let res=menuList
    console.log("res",res)
    // throw new Error("")
    resolve( res )
  })
}
